package alibaba.server;

import java.util.Arrays;

public class ListingEntry {

	private static final long serialVersionUID = 1L;
	private String filename;		// User filename
	private String localName;		// Filename when stored on the server
	private byte[] fileHash;		// File SHA1 hash

	private String owner;			// File owner
	private int[] snapshotVersion;	// The snapshot mapping for the file
	
	public ListingEntry() {
		this.filename = null;
		this.localName = null;
		this.fileHash = null;
		
		this.owner = null;
		this.snapshotVersion = null;
		
	}

	/**
	 * Create simple file entry.
	 * 
	 * @param filename
	 * @param fileHash
	 */
	public ListingEntry(String filename, String localName, byte[] fileHash) {
		super();
		this.filename = filename;
		this.localName = localName;
		this.fileHash = Arrays.copyOf(fileHash,fileHash.length);
		
		this.owner = null;
		this.snapshotVersion = null;
	}

	public String getFilename() {
		return filename;
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	public String getLocalName() {
		return localName;
	}

	public void setLocalName(String localName) {
		this.localName = localName;
	}

	public byte[] getFileHash() {
		return fileHash;
	}

	public void setFileHash(byte[] fileHash) {
		this.fileHash = fileHash;
	}

	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}

	public int[] getSnapshotVersion() {
		return snapshotVersion;
	}

	public void setSnapshotVersion(int[] snapshotVersion) {
		this.snapshotVersion = snapshotVersion;
	}
	
	
}




